UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WR82yOjWV72dYAU74hwGATc2nEnhck7qqF6PW8JUr4A=' 
WHERE 
  key_id = '0d2bebeb96ac65b4181032f898c25a1391407b2044afaa24b1f46b7657283279' 
  AND (
    token = 'WR82yOjWV72dYAU74hwGATc2nEnhck7qqF6PW8JUr4A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028