UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lB14yCSAK8cGyH/PaNRVu8JqJ7iueUoKj2d0tjrSCRU=' 
WHERE 
  key_id = '3cfd12e00d08bbe7cbee5daebff5efeffe28f5dca4d8e4bb146c6a5cb1758a98' 
  AND (
    token = 'lB14yCSAK8cGyH/PaNRVu8JqJ7iueUoKj2d0tjrSCRU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028