UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h9+LH+ezmt8Dp9vBiKc/jPsYL8O/2I9YL43H5AqhYbo=' 
WHERE 
  key_id = 'a89ae8c90a285375397292bd51ed6a98c9619c5235fb21dcedb7d78223f9d61d' 
  AND (
    token = 'h9+LH+ezmt8Dp9vBiKc/jPsYL8O/2I9YL43H5AqhYbo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030