UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm+OHJIu0GyjZpx/8f7NMGLCbw266/zk15c7oEhy9PA4=' 
WHERE 
  key_id = '8d85d546e1e9f1b2d27de38c71784330a490c4dc3c98873ea5ac503251fb0c6a' 
  AND (
    token = 'm+OHJIu0GyjZpx/8f7NMGLCbw266/zk15c7oEhy9PA4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060