UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fpEE2TsDucRz5QbGT/IrP4mWUM4TM60byF/DfvvXK9U=' 
WHERE 
  key_id = '9533cd061e55576aa8435ec7bc7b22e899d558d5e125f82a293d793869845bd7' 
  AND (
    token = 'fpEE2TsDucRz5QbGT/IrP4mWUM4TM60byF/DfvvXK9U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045