UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GrGaBohd8RXds7Bngo6dbgdjE+hjRCyDiQZHxPwgYxY=' 
WHERE 
  key_id = '535567822a95fc1ce98bdb6f1b788fc841af5878f130586b4c073d86c16a6d4f' 
  AND (
    token = 'GrGaBohd8RXds7Bngo6dbgdjE+hjRCyDiQZHxPwgYxY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021