UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7IFMb7a2QGAUk82DlfZvRcVkQB/Ok5Jhjk0thDiTY0Q=' 
WHERE 
  key_id = '58248c76a4a39b1fd671613a4524d3dbd9107d01ef32211de9a695c7fa9f5aa9' 
  AND (
    token = '7IFMb7a2QGAUk82DlfZvRcVkQB/Ok5Jhjk0thDiTY0Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022