UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xjuxQLELM9eH2a2ZZN78cWDuusZ6PVws69uZds6/XSc=' 
WHERE 
  key_id = '191432527d026c498de7c428cb59f6e8ec6f3f255e89db65afe483b83b528c76' 
  AND (
    token = 'xjuxQLELM9eH2a2ZZN78cWDuusZ6PVws69uZds6/XSc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018