UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1N/CtmlvelOx4UPnH0h8YU35cguYTwC9JpP0xv5HjSc=' 
WHERE 
  key_id = 'c24e257716c48262e572f3f33afd5c0ff9916402f71b504f095a745d0bd6f39c' 
  AND (
    token = '1N/CtmlvelOx4UPnH0h8YU35cguYTwC9JpP0xv5HjSc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019