UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F6SKyfCqE6J5G2cF8xdeAMFwStk374Q1TQU+Y8fpnUo=' 
WHERE 
  key_id = '13bf6a726659d7a8ab980f2424f6e1e22b52e4b5c1222432f8eedf2e7e6ed716' 
  AND (
    token = 'F6SKyfCqE6J5G2cF8xdeAMFwStk374Q1TQU+Y8fpnUo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018