UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZKyRi/5TT1T76TKX4FedsRnoB7QiEJQhzAdA62pwacM=' 
WHERE 
  key_id = 'ad93ea2257a935eb389387d78750aef29daf433af3659188efd4669d5d6c9acf' 
  AND (
    token = 'ZKyRi/5TT1T76TKX4FedsRnoB7QiEJQhzAdA62pwacM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028