UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tVj/gg7M7DUuDS2She+adDGOOf/BmTTITNA7vz7EA9g=' 
WHERE 
  key_id = 'e5cb4bf799ef5bf6a24fd5963c0d8c42af25a9cbda194bfaaa12498e07bd207f' 
  AND (
    token = 'tVj/gg7M7DUuDS2She+adDGOOf/BmTTITNA7vz7EA9g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033