UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BeYXANUIfnmK6aHzqGY3Q0MuZGi/XJ0c4xHvT0M/jkM=' 
WHERE 
  key_id = '5d23d863bee43f553db2b40f4d0b27901a4cfddda6797517d3cf9ea6abc1b1ac' 
  AND (
    token = 'BeYXANUIfnmK6aHzqGY3Q0MuZGi/XJ0c4xHvT0M/jkM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033