UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AcxDDHHX7yows3B7cLkv4A1caMsuh+37hMXq3PwUOqk=' 
WHERE 
  key_id = '079f8d87edddfc80a15e1b67336fc6c71d74e3907b1fa1c4fd20ec0aafd023ed' 
  AND (
    token = 'AcxDDHHX7yows3B7cLkv4A1caMsuh+37hMXq3PwUOqk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043