UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Yl2Ls5qsUpWJAksCLbcLxQVbYmKiYt5/yFCab5u9I6s=' 
WHERE 
  key_id = 'eb281d2fc2855967ccdbded57b6feea4cd3f41bd7ad6a02511cb85636dbfcd7b' 
  AND (
    token = 'Yl2Ls5qsUpWJAksCLbcLxQVbYmKiYt5/yFCab5u9I6s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033