UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LTAbzSxvS1sVBNHvn97lA/4ZYIjmnM+C36IdSWFVfCw=' 
WHERE 
  key_id = '0b3ac61fc72a3a1580094cb3a91e4af044340f36fa7bd9b6c25399974b8f76e6' 
  AND (
    token = 'LTAbzSxvS1sVBNHvn97lA/4ZYIjmnM+C36IdSWFVfCw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023