UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MMYTD8nBGM7NXiRrQE+R8JSEGd86fb5k+LZdtaU3lrw=' 
WHERE 
  key_id = 'd043fb36c473e32cb29f42dd9428ef6cf9cbaba8e2675a412a6c77dd5a556d6e' 
  AND (
    token = 'MMYTD8nBGM7NXiRrQE+R8JSEGd86fb5k+LZdtaU3lrw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023