UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vbUIJQBvl2MGPw94EtQsXuRjDEKyzwL34HgGMdNBR2A=' 
WHERE 
  key_id = '9172bf6e5adb416f48afe8ccdf693b19128afa27b934b2493b5f88b0b72a4761' 
  AND (
    token = 'vbUIJQBvl2MGPw94EtQsXuRjDEKyzwL34HgGMdNBR2A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034