UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+0GHx3+EUnZ4BIbaxiM5gvLV7QsvV2ZrYfXRhmV227E=' 
WHERE 
  key_id = '02e020f62b8418d50b995d4920fd4c2c96b39e622bb4f1c72a8afc3334108e24' 
  AND (
    token = '+0GHx3+EUnZ4BIbaxiM5gvLV7QsvV2ZrYfXRhmV227E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00073