UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HgjUGZWIl2KjL3QFLUDGwnszdu7ukcp9vr6dVdDWYKs=' 
WHERE 
  key_id = '4fda8a3499c77d02372e4603d180e192c07fcd760ec1e7b5fd9bb2b11e43dbec' 
  AND (
    token = 'HgjUGZWIl2KjL3QFLUDGwnszdu7ukcp9vr6dVdDWYKs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027