UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LDdoK3MVNOcRxPuM51MOF0OzFbLgxpve4uRo3C12A5E=' 
WHERE 
  key_id = '8812a13b11089b1d5cc8856d0573d9bff58e32cfeb267846ba6c9c4ad7e52ea3' 
  AND (
    token = 'LDdoK3MVNOcRxPuM51MOF0OzFbLgxpve4uRo3C12A5E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046