UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qbICnstSNZaECf/6AqnNvnk3H/uGG/39D1fCrxjOfwI=' 
WHERE 
  key_id = '8ceac7f37667b9a884330a1c353b8df3d1fa402589e7e6c6447d441fc8330dc8' 
  AND (
    token = 'qbICnstSNZaECf/6AqnNvnk3H/uGG/39D1fCrxjOfwI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028