UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rQbDDlntBEgTjP8biZJWOBsXJKNFUr1gLN7V4+4kS5E=' 
WHERE 
  key_id = '2ace41a9627bcf769be4285d3ea931eb3820d0b00c5334fd3cccf79d036db20f' 
  AND (
    token = 'rQbDDlntBEgTjP8biZJWOBsXJKNFUr1gLN7V4+4kS5E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028