UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wfhko8AzYpMs7Ba7yizTkPOTSEpxbquDsPBH+74w4qU=' 
WHERE 
  key_id = '06226e6669632228d2b2a5543385b2af3f39e82e05b2d5e2b1b8ac3d15128865' 
  AND (
    token = 'Wfhko8AzYpMs7Ba7yizTkPOTSEpxbquDsPBH+74w4qU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027