UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VaABZg3ubzTwGbweiYpDvBIQfHtXxOEEpCVYTl4EA0E=' 
WHERE 
  key_id = '202e8bba25e1904c763e31899c3f8cf26dfdbf504ffd35cd31da11a1b10450f0' 
  AND (
    token = 'VaABZg3ubzTwGbweiYpDvBIQfHtXxOEEpCVYTl4EA0E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035