UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8330/vYiIrtmf2Mr7B5udDEn7dwmFwn8ANT/a9vjgJE=' 
WHERE 
  key_id = 'c2d00c0598ac801c4bd8de4f9fd009ce12168faf27290c4c48a11a2d62a2afcc' 
  AND (
    token = '8330/vYiIrtmf2Mr7B5udDEn7dwmFwn8ANT/a9vjgJE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031