UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fQngrDXyE0cgMHhS26SZFqb+vn6l8Zy4de/JmyNwoK0=' 
WHERE 
  key_id = '5667d4756a9439454a5025ea40b357338a629ab45c4c0160fa66910716675f84' 
  AND (
    token = 'fQngrDXyE0cgMHhS26SZFqb+vn6l8Zy4de/JmyNwoK0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051