UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JnRNS/CJJ+jDtS2qRjpXbsXdX45KKkZJIDQ4+D7wYqQ=' 
WHERE 
  key_id = '1131a8e326b30cf1640308c3792c434a67940a35d229933f2d88307330b1d202' 
  AND (
    token = 'JnRNS/CJJ+jDtS2qRjpXbsXdX45KKkZJIDQ4+D7wYqQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025