UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+r8/SOZ7D1TH1Pyz6JpW+W4aCjpieeyd0Sz6gCwWjXc=' 
WHERE 
  key_id = '0dc69a4ef014f7b1ac942b518516145699eb203036d85b2b09c8209791d24385' 
  AND (
    token = '+r8/SOZ7D1TH1Pyz6JpW+W4aCjpieeyd0Sz6gCwWjXc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036