UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qwo8TKjQExo6kEyEBsaEEW6MMJ0/xg8WjKa0xnyFSJg=' 
WHERE 
  key_id = 'b1e6b3c2e38e24a452ddcc1851e174595b49b5936d9189e4312ad2a154da9925' 
  AND (
    token = 'qwo8TKjQExo6kEyEBsaEEW6MMJ0/xg8WjKa0xnyFSJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043