UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZyHIN9axdOr2YFLf4pVh0MeCFh41hNZoQYCVEcZM4h4=' 
WHERE 
  key_id = '16ce02c5a3984c477940912909f91e1a95a0e356cef1a00a12f0e2ed8e39549c' 
  AND (
    token = 'ZyHIN9axdOr2YFLf4pVh0MeCFh41hNZoQYCVEcZM4h4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022