UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cr2bYBUxuilonuYzkE0s6iR0OpInROoZ9XB2kkfdEds=' 
WHERE 
  key_id = '439eef9aae2f2b3172f670b4a6174a27b3ce8c2e9acc33d43574f1eca9638b20' 
  AND (
    token = 'cr2bYBUxuilonuYzkE0s6iR0OpInROoZ9XB2kkfdEds=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045