UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HdbIJO0GUsmSLW2ueu0GydtZ52OHD5dIld98Cyb/P6I=' 
WHERE 
  key_id = '11ce92acbf136713db5d7b84eb2b8cf7783862c2e77dc4fcf06fc58414d0ef3f' 
  AND (
    token = 'HdbIJO0GUsmSLW2ueu0GydtZ52OHD5dIld98Cyb/P6I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030