UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UiNkXjCeSs9XyTpcDosYFOhvf295GgIOxPTrCb9ExaI=' 
WHERE 
  key_id = 'b06ba33023f73c11f4320b02b951301f28e7b1d9834440861fc768e523ad988d' 
  AND (
    token = 'UiNkXjCeSs9XyTpcDosYFOhvf295GgIOxPTrCb9ExaI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023