UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7034/fc2iCm5EVY9tKLgJafIodyWhLoaalVVKuZ5CPM=' 
WHERE 
  key_id = 'd8c7437a978a57718fb56a3d5a8ef435b1b9381aabd0562130d805978726cb7d' 
  AND (
    token = '7034/fc2iCm5EVY9tKLgJafIodyWhLoaalVVKuZ5CPM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047