UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'why05b1nSv3I7j4e+RfyCfWCVCibMZp6FPe3EMJrDnU=' 
WHERE 
  key_id = 'c9b9a119ca0bb33011a9002c68fc2dc9e74c6a2c3fb9d410e22e8ff160f8edae' 
  AND (
    token = 'why05b1nSv3I7j4e+RfyCfWCVCibMZp6FPe3EMJrDnU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036